package com.dao;

import com.dto.BorrowBookDTO;
import com.dto.RecordDTO;
import com.po.RecordPO;
import com.vo.BookVO;
import com.vo.UserRecordBarVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author linyukun
 * @date 2022/7/5 19:08
 */
@Mapper
@Repository
public interface RecordDao {
    List<RecordPO> getRecordListByBookId(@Param("bookId") long bookId);

    Integer batchInsertBorrowBook(@Param("list")List<RecordDTO> borrowBooks,@Param("userName") String userName);

    List<RecordPO> getBorrowRecordByUserName(@Param("userName")String userName);

    List<RecordPO> getBorrowRecordByUserNameList(@Param("dto")BorrowBookDTO dto);

    List<RecordPO> getAllRecordByUserName(@Param("dto") BorrowBookDTO dto);

    List<RecordPO> getBorrowRecordByBookStockId(@Param("bookStockId")Long bookStockId);

    void updateBookStrokStatusIsBorrow(@Param("bookStockId") Long bookStockId);

    Integer batchBackBook(@Param("list")List<RecordDTO> borrowBooks,@Param("userName")  String borrowUserName);

    Integer renewBooks(@Param("list")List<RecordDTO> recordDTOs);

    List<RecordPO> getRecordHistoryList(@Param("dto")BorrowBookDTO dto);

    List<UserRecordBarVO> getUserRecordBarYear(@Param("dto")BorrowBookDTO dto);

    List<UserRecordBarVO> getUserRecordBarYearDetail(@Param("dto")BorrowBookDTO dto);

    List<BookVO> getBorrowRanking(@Param("dto")BorrowBookDTO dto);

    void updateRecordEmailNotification(@Param("dto")RecordDTO dto);

    void updateNoBackRecordInfo();
}
